﻿Imports Zytonic_Framework.Extentions.FileInfoExtentions
Imports Zytonic_Framework.Math
Imports System.Windows.Media.Animation

Public Class InformationWindow
    Public WithEvents ClosingStoryboard As Storyboard
    Public Sub New(Filename As String, Y As Double)

        ' This call is required by the designer.
        InitializeComponent()

        ' Add any initialization after the InitializeComponent() call.

        Dim FileInfo As New IO.FileInfo(Filename)
        If FileInfo.isDirectory Then
            Me.TitleText.Text = FileInfo.FullName.Remove(0, FileInfo.FullName.LastIndexOf("\") + 1)
        Else
            Me.TitleText.Text = IO.Path.GetFileNameWithoutExtension(FileInfo.FullName)
        End If
        Border.Background = DirectCast(MyProperties.DockWindow.PinStackPanel.Background, SolidColorBrush)
        Border.BorderBrush = Border.Background
        Me.ClosingStoryboard = DirectCast(FindResource("OnMouseLeave1"), Storyboard)
        Me.Left = 28
        Me.Top = Y - 15
    End Sub

    Private Sub ClosingStoryboard_Completed(sender As Object, e As EventArgs) Handles ClosingStoryboard.Completed
        Me.Close()
    End Sub

End Class
